home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
tlx_sq15.zip
/
LOGON.SLT
< prev
next >
Wrap
Text File
|
1991-01-31
|
28KB
|
791 lines
//-----------------------------------------------------------
// LOGON.SL? Automatic logging into any BBS.
str upload [] = "UPLOAD" // Name of upload script.
,grabmail[] = "GRABMAIL" // Name of GrabMail script.
,dnload [] = "DNLOAD" // Name of download script.
,mailup [] = "MAILUP" // Name of mail upload script.
;
//-----------------------------------------------------------
// Please look at the comments through the whole file, and modify to
// suit your needs before you use it. Then recompile with CS LOGON.
// Modify your dialing directory as follows: linked script should be
// set to LOGON, and your password should be set to whatever it is.
//-----------------------------------------------------------
str bbs_type [32] // BBS type.
,bbs_name [32] // BBS name.
,User [32] // Your own name.
,logfile [32] // Log file name.
,shortname[ 8] // BBS name,
,codename [ 8] // ID-code,
,help [80] // For various help
,Sdoor [2] // PCB door (ASCII)
,lline [60] // Read last line.
,check [4] // For checking "short" globals.
,show []="DISPLAY" // Script to display logoff/exit status
,global []="GLOBAL" // Name of Global script.
,bbsname []="BNAME" // Global containing BBS name.
,cname []="CNAME" // Codename for current BBS.
,bbstype []="BTYPE" // BBS type.
,mscript []="MDOOR" // Mail script/door.
,short []="SHORT" // Shortened BBS name.
,conf []="CONF" // Current conference.
,username[]="NAME" // User name
,dpass []="DPASS" // Default password
,passw []="PASSW" // Current password
,graph []="GRAPH" // Graphics: YES or NO.
,cprot []="CPROT" // Current protocol.
,hprot []="HPROT" // "His" protocol.
,version []="PCBVER" // PCB version.
,logoff []="LOGOF" // Auto-Logof setting.
,status []="STATUS" // Line number of status line.
,changed []="CHANGE" // Status line changed.
;
int tol = 300 // No activity for 30 seconds
,stat, tmark // makes script time out.
,pcb // 1 for PCBoard, 2 for ProLogon, otherwise 0.
,mbbs, rbbs // TRUE for MBBS / RBBS
,opus, fido, crcs // TRUE for corresponding system.
,PCBver // PCB version no.
,y // Y coordinate for writing on screen.
,pw1 // Trig for password request
;
//-----------------------------------------------------------
// Script starts here.
//-----------------------------------------------------------
main()
{
int c, error, i, l, na;
int pcb1, pcb2, pcb3 // Trigs for various PCBs
,more
,ohd
,WantGrab
;
// Only if the Global script is loaded.
//-----------------------------------------------------------
if (!is_loaded(global)) // If Global script is not
{ clear_scr();
box (13,7,62,14,176,1,15);
box (15,8,60,13,177,1,15);
box (17,9,58,12,178,1,15);
pstraxy (" Sorry - the LOGON script only works ",18,10,79);
pstraxy (" if you execute the Qdial script first! ",18,11,79);
gotoxy (0,20);
failtone();
goto end2;
}
// Start all tracking at once - just in case something takes long.
pcb1 = track ("age # to use",0); // Check for PCboard / ProLogon
pcb2 = track ("roLogon",0);
pcb3 = track ("now active",0);
opus = track ("OPUS",0); // Check for OPUS BBS
more = track ("--more--",0); // Check for the "more" prompt
ohd = track ("Hard Disco", 1); // Cut OHD's crap.
na = track ("ur first name", 1); // Request for name.
bbs_name = _entry_name;
i = strposi (bbs_name,"D:",0); // Find "D:" in string.
if (i < 0)
i = strlen (bbs_name); // Not found: Use length.
for (--i; i>1; --i)
if (subchr (bbs_name,i)!=' ') break; // Delete trailing spaces.
setchr (bbs_name,i+1,0); // This is last character.
y = 1;
display (bbs_name,0,12); // Write it on the screen.
i = strlen (bbs_name);
y = display (" answered. ",i,12);
// Extract the first 8 alphabetic characters
// to get the short name.
c = 0;
error=strlen (bbs_name);
for (i=0; (error=subchr (bbs_name,i)) > 0; ++i)
{ if (isalpha(error=toupper(error)))
{ setchr (shortname,c,error);
++c;
if (c > 7) break;
}
}
setchr (shortname,c,0); // End string.
write (short,shortname); // Enter short name into global.
logfile = "LOG\"; // Logfile directory.
strcat (logfile,shortname);
stat = capture_stat(); // Check capture file status.
if (stat)
capture ("*CLOSE*");
y = display("Opening log file... ",0,15);
fdelete (logfile); // Delete previous file.
if(capture(logfile) < 0)
y = display("LOG FILE NOT OPENED! ",0,15);
else
{ i = display ("Capturing into ",0,15);
y = display (_capture_fname,15,62);
}
entry (); // Update colors & status bar.
write (bbsname,bbs_name); // Write BBS name to global.
read (status,check);
i = stoi (check); // Find status line.
terminal();
pstraxy (" ",0,i,116);
pstraxy (bbs_name,1,i,116); // Write BBS name on status line.
gotoxy (0,++y); // Move back up.
// Only if online.
i = 0;
while (!carrier())
{ delay(1);
if (++i > 10)
if (!carrier())
{ failtone();
release();
status_wind ("THIS SCRIPT ONLY WORKS IF YOU'RE ONLINE!",20);
return (-1);
}
}
goodtone();
write (changed,"YES"); // Make "display" update status
call (show); // line - Telix destroyed it.
bbs_type="MBBS"; // set MBBS type (default)
if (strlen(_entry_pass) > 0)
lline = _entry_pass;
else
read (dpass,lline); // Get default password.
write (passw,lline); // Set current password.
read (username,User); // Get the user name.
i = strlen (User);
setchr (User,i,13); // Add a CR.
_zmod_auto = 1; // Set auto download to true
set_defprot ('Z'); // Set default protocol (Zmodem)
pcb=mbbs=rbbs=opus=fido=crcs=0; // System not defined yet!
tmark = timer_start (tol); // Gimme more time.
error = 1;
while ((stat=trig()) > 0) // Exit on first trig.
{ if (stat == ohd) // check for OHD.
cputs ("^K^K^K"); // Cut the crap.
else if (stat == more) // More?
cputs ("N^M"); // No thanx!
else
release(); // Release tracks and timer.
if (stat==pcb1 || stat==pcb2 // Check for PCBoard.
|| stat==pcb3)
{ bbs_type = "PCB";
pcb = 1;
if (stat==pcb2) ++pcb; // Set correct PCBoard type.
break; // 1=PCBoard, 2=ProLogon
}
else if (stat == opus) // check for OPUS
{ bbs_type = "OPUS"; // Log on using OPUS script.
opus = 1;
break;
}
else if (stat == fido) // check for FIDO
{ bbs_type = "FIDO"; // Log on using FIDO script.
fido = 1;
break;
}
else if (stat == crcs) // check for CRCS
{ bbs_type = "CRCS"; // Log on using CRCS script.
crcs = 1;
break;
}
else if (st